def match_num(num):
    f=[6,2,5,5,4,5,6,3,7,6]
    if num==0: return f[num]
    total = 0
    while(num>0):
        total += f[num % 10]
        num = num // 10
    return total

snum = 6
print('使用6根火柴, 你可以拼出这些自然数:')
for i in range(1001):
    if match_num(i)==snum:
        print(i)